1. Field of the Invention
This invention relates to a method of processing nested layers in multi-layered messages.
2. Description of Related Art
Many different conventional communication networks are in existence today, including optical, RF, broadband and narrow-band networks in either a cabled or a cable-less configuration. A typical communication network has an architecture based upon layers arranged in a protocol stack. Each layer corresponds to a service performed within the communication network. Each layer offers a service to the next higher layer, while shielding that layer from the implementation details of its own layer. Each layer also accesses a service offered by its immediate lower layer without bypassing any other layers.
One such conventional model for a layered communication network architecture is the Open Systems Interconnection (OSI) model, which delineates the services of a communication network into seven layers. FIG. 1a is a symbolic representation of the OSI model. The layers in the OSI model are, in ascending order, layer 1: the physical layer, layer 2: the data link layer, layer 3: the network layer, layer 4: the transport layer, layer 5: the session layer, layer 6: the presentation layer, and layer 7: the application layer. Each layer implements one or more protocols for the service at that layer. Layer 1, the physical layer, is concerned with the unstructured bit stream over a physical medium. Layer 2, the data link layer, provides for reliable transfer of information across the physical link using synchronization, flow control and error control as necessary. Layer 3, the network layer, provides independence from data transmission and switching technologies and is responsible for establishing, maintaining, and terminating connections. Layer 4, the transport layer, provides reliable transparent transfer of data between end points with end-to-end error recovery and flow control as needed. Layer 5, the session layer, establishes, manages and terminates connections (sessions) between cooperating applications. Layer 6, the presentation layer, provides independence to the application from differences in data presentation such as the format of the data and/or data encryption (scrambling/descrambling). Layer 7, the application layer, provides access to the OSI environment for the application running on behalf of the user. Examples of such applications are file transfer, terminal emulation, electronic mail, wireless telephony, etc. The application layer is often referred to as the “user” level. Data transmitted at the user level may be user text, binary data, voice data and/or image data, etc.
Other data communication network architectures follow the general principles of the OSI model. The general principles are pertinent to this invention and not the exact number of layers or the exact service provided by each layer.
Data communication messages transmitted through the layers of a communication network are arranged as nested messages. The term “nested” is used to describe a network architecture in which a message of one layer is nested within a message of an adjacent lower layer. FIG. 1b illustrates messages at generic layers i, j and k. While a different message exists at each layer of the communication network, the messages are actually different versions of a single message as it progresses through the communications network. A message, when it is, for example, at layer k, may be referred to as “the message at layer k” or “layer k message”. As the message progresses “downward” through the protocol stack, each layer encapsulates the message body of the next higher layer with its own header and, optionally, trailer information. Therefore, the layer j message consists of the layer k message encapsulated with layer j header and, optionally, j trailer information. Similarly, the layer i message consists of the layer j message encapsulated within layer i header and, optionally, i trailer information. The header has a length field (len) containing the length (in octets or bits) of the encapsulated information following the header. The length field is used to determine where the trailer begins. The trailer may require a cyclic redundancy check (CRC) calculation to generate a frame check sequence (FCS) field. The FCS field is used to conform to a bit error rate with acceptable levels by detecting bit errors, and ordering the layer containing the particular trailer to request re-transmission of a message when a bit error occurs. For illustrative purposes, the layer k in FIG. 1b corresponds to the user layer.
In the OSI model, as messages are passed between layers, a copy of a formatted buffer is passed from layer to layer. In addition, every message must proceed through every layer of the protocol stack. At each layer of the OSI model, a message buffer exists which contains an instance of the message at that layer.
FIG. 2 illustrates a conventional method for processing layer 1 through n messages between layers in a conventional communication network; In FIG. 2, encoding of a higher level layer j+1 message and nesting of a higher level layer j+1 message within a next lower level layer j message is illustrated. Encoding of a message at a layer moves message field values in the message to octets or bits of a formatted message stream. After all of the messages at each layer in a protocol stack are processed, the resultant message stream is the octet or bit buffer that holds all of the formatted layers, the formatted messages being ready for transmission over the physical layer of the communication network.
In FIG. 2, the input to processing the message at an initial layer is a new or free buffer, and the initial message body information and its length. The initial message body may be user data. The process begins with the upper most layer n. In step S12, the initial buffer position is set as equal to the value of the current buffer position. The length field for the header for the layer n message is computed from the header length and the body length in step S13. In step S14, the header is encoded into the message stream, and the current buffer position is incremented by the header length in step S15. In step S16, the message body for the message at layer n is copied into the current buffer position, and the current buffer position is incremented by the message body length in step S17. A cyclic redundancy check (CRC) field is computed in step S18. In step S19, the trailer is encoded into the message stream and the current buffer is incremented by the trailer length in step S20. The message length for the layer n message is calculated in step S21. The method then returns to Start, and the initial buffer position and the current formatted length becomes the message body and length for layer n−1 message. When all layers have been processed in this manner, the resultant buffer is the sum of the all the layers formatted into a message stream buffer and ready for transmission on the physical layer.
Each layer does not know about the other layer's headers and trailers or their sizes. The conventional method consists of passing the address of each layer's formatted message buffer to the next layer. Therefore, in the conventional method, a separate buffer must be used to process each layer. This incurs a buffer copy of a formatted message at each layer and consumes extra processing time. Also, the higher layer's processing must be completed before the message length and CRC fields can be determined in the currently processed layer.